package com.demo.controller;

import com.demo.ResponseResult;
import com.demo.domain.entity.LogisticsSend;
import com.demo.service.LogisticsSendService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



@RestController
@CrossOrigin(origins = "*")
public class LogisticsController {
    @Autowired
    private LogisticsSendService logisticsSendService;

    //下单
    @PostMapping("/logisticssend")
    public ResponseResult LogisticsSend(@RequestBody LogisticsSend logisticsSend){
        return logisticsSendService.logisticsSend(logisticsSend);
    }

    //用户查看订单
    @GetMapping("/viewOrder")
    public ResponseResult viewOrder(@RequestParam  Integer pageNumber){
        return logisticsSendService.viewOrder(pageNumber);
    }


    //支付
    @PutMapping("/logisticssend")
    public ResponseResult Logisticsput(@RequestBody LogisticsSend logisticsSend){
        return logisticsSendService.logisticsput(logisticsSend);
    }
    //修改物流状态
    @PutMapping("/logisticsup")
    public ResponseResult Logisticsinfoput(@RequestBody LogisticsSend logisticsSend){
        return logisticsSendService.logisticsinfoput(logisticsSend);
    }

}
